package com.rany.day08.demo05;

import java.util.HashSet;

public class LinkedHashSet {
    public static void main(String[] args) {
        //无序，不可重复
        HashSet<String> hashSet = new HashSet<>();
        hashSet.add("www");
        hashSet.add("sunline");
        hashSet.add("com");
        System.out.println(hashSet);

        //有序，不可重复
        java.util.LinkedHashSet linkedHashSet = new java.util.LinkedHashSet();
        linkedHashSet.add("www");
        linkedHashSet.add("sunline");
        linkedHashSet.add("com");
        System.out.println(linkedHashSet);
    }
}
